package com.ruoyi.warehouse.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.warehouse.mapper.ZnWarehouseMapper;
import com.ruoyi.warehouse.domain.ZnWarehouse;
import com.ruoyi.warehouse.service.IZnWarehouseService;

/**
 * 仓库信息管理Service业务层处理
 * 
 * @author ruoyi
 * @date 2023-06-13
 */
@Service
public class ZnWarehouseServiceImpl implements IZnWarehouseService 
{
    @Autowired
    private ZnWarehouseMapper znWarehouseMapper;

    /**
     * 查询仓库信息管理
     * 
     * @param id 仓库信息管理主键
     * @return 仓库信息管理
     */
    @Override
    public ZnWarehouse selectZnWarehouseById(Long id)
    {
        return znWarehouseMapper.selectZnWarehouseById(id);
    }

    /**
     * 查询仓库信息管理列表
     * 
     * @param znWarehouse 仓库信息管理
     * @return 仓库信息管理
     */
    @Override
    public List<ZnWarehouse> selectZnWarehouseList(ZnWarehouse znWarehouse)
    {
        return znWarehouseMapper.selectZnWarehouseList(znWarehouse);
    }

    /**
     * 新增仓库信息管理
     * 
     * @param znWarehouse 仓库信息管理
     * @return 结果
     */
    @Override
    public int insertZnWarehouse(ZnWarehouse znWarehouse)
    {
        znWarehouse.setCreateTime(DateUtils.getNowDate());
        return znWarehouseMapper.insertZnWarehouse(znWarehouse);
    }

    /**
     * 修改仓库信息管理
     * 
     * @param znWarehouse 仓库信息管理
     * @return 结果
     */
    @Override
    public int updateZnWarehouse(ZnWarehouse znWarehouse)
    {
        znWarehouse.setUpdateTime(DateUtils.getNowDate());
        return znWarehouseMapper.updateZnWarehouse(znWarehouse);
    }

    /**
     * 批量删除仓库信息管理
     * 
     * @param ids 需要删除的仓库信息管理主键
     * @return 结果
     */
    @Override
    public int deleteZnWarehouseByIds(Long[] ids)
    {
        return znWarehouseMapper.deleteZnWarehouseByIds(ids);
    }

    /**
     * 删除仓库信息管理信息
     * 
     * @param id 仓库信息管理主键
     * @return 结果
     */
    @Override
    public int deleteZnWarehouseById(Long id)
    {
        return znWarehouseMapper.deleteZnWarehouseById(id);
    }
}
